<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<script type="text/javascript">
	function articleDelete(articleId){
		if(confirm("您确定要删除这篇博文吗？")){
			window.location="articleManage?action=delete&articleId="+articleId;
		}
	}
</script>
<div class="data_list">
	<div class="data_list_title">
		<img src="${pageContext.request.contextPath}/image/icon/list_icon.png" />
		列表<span class="article_add">
			<button class="btn btn-mini btn-success" type="button"
				onclick="javascript:window.location='articleManage?action=preSave'">写文章</button>
		</span>
	</div>
	<div class="article_datas">
		<table class="table table-hover table-striped">
			<tr>
				<th>时间</th>
				<th>名称</th>
				<th>操作</th>
			</tr>
			<c:forEach var="article" items="${articles}">
				<tr>
					<td>『<fmt:formatDate value="${article.pubDate }" type="date"
							pattern="yyyy-MM-dd" />』
					</td>
					<td><a
						href="articleManage?action=show&articleId=${article.id }">${article.title }</a></td>
					<td><button class="btn btn-mini btn-info" type="button"
							onclick="javascript:window.location='articleManage?action=preSave&articleId=${article.id }'">修改</button>&nbsp;
						<button class="btn btn-mini btn-danger" type="button"
							onclick="articleDelete(${article.id })">删除</button></td>
				</tr>
			</c:forEach>
		</table>
	</div>
</div>
